<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hỗ trợ trực tuyến</title>
<link rel="stylesheet" href="../skins/sa/resources/css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../skins/sa/resources/css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../skins/sa/resources/css/invalid.css" type="text/css" media="screen" />
<script type="text/javascript" src="../skins/sa/resources/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../skins/sa/resources/scripts/simpla.jquery.configuration.js"></script>
<script type="text/javascript" src="../skins/sa/resources/scripts/facebox.js"></script>
<script type="text/javascript" src="../skins/sa/resources/scripts/jquery.wysiwyg.js"></script>
</head>

<p align="center" class="<?php echo $_SESSION['msg_type']?>">
    <img src="../images/<?php echo $_SESSION['msg_type']?>.png" height="20" />
<?php
    /*echo $_SESSION['msg'];
    unset($_SESSION['msg']);  
    */   
?>
    </p>
    
<script language="javascript">
    function kiemtra(){
        
        var them = document.fthem;
		var co = true;
        if(them.ho_ten.value=='') {
            //alert('Vui lòng thêm Họ tên!');
			document.getElementById('tb_ho_ten').style.display='';
            //them.ho_ten.focus();
            co = false;
        }
       
        if(them.nick_chat.value=='') {
            //alert('Vui lòng thêm Nick chat!');
			document.getElementById('tb_nick_chat').style.display='';
            //them.nick_chat.focus();
            co = false;
        }
       
        if(them.thu_tu_hien_thi.value=='') {
            //alert('Vui lòng thêm Thứ tự hiển thị!');
			document.getElementById('tb_thu_tu_hien_thi').style.display='';
            //them.thu_tu_hien_thi.focus();
            co = false;
			
        }
		return co;
   
    }
    
    var http_request = false;
    function makeRequest() {
      http_request = false;
      
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            // set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('GET', 'kiem_tra_ma_sua.php?Ma_sua='+fthem.Ma_sua.value , true);
      http_request.send(null);
    }
    
    function alertContents() {
      if (http_request.readyState == 1){
          document.getElementById('Ma_sua_span').innerHTML = '<img src="../images/loading.gif" />';
         }
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            result = http_request.responseText;
            if(result=="Yes") document.getElementById('Ma_sua_span').innerHTML = 'Mã sữa bị trùng!';
            if(result=="No") document.getElementById('Ma_sua_span').innerHTML = '<img src="../images/success.png" height="18" />'; 
            if(result=="Empty") document.getElementById('Ma_sua_span').innerHTML = 'Bạn chưa nhập mã sữa!'; 
         } else {
            alert('There was a problem with the request.');
         }
      }
    }

</script>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include '../widgets/sidebar.php'?>
  <!-- End #sidebar -->
  
  <div id="main-content"> <!-- Main Content Section with everything -->
    
    <noscript>
    <!-- Show a notification if the user has disabled javascript -->
    <div class="notification error png_bg">
      <div> Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly. </div>
    </div>
    </noscript>
    
    
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Hỗ trợ trực tuyến</h3>
        <ul class="content-box-tabs">
          <li><a href="list.php">Danh sách</a></li>
          <!-- href must be unique and match the id of target div -->
          <li><a class="default-tab">Thêm</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div style="display: block;" class="tab-content default-tab" id="tab2">
          <form  name="fthem" id = "gido" action="add_sm.php" method="post" enctype="multipart/form-data" >
            <fieldset>
              <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
              
              <table>
                <tbody>
                  <tr class="alt-row">
                    <td width="25%"><label class="required"> Họ và tên </label></td>
                    <td width="75%"><input type="text" class="text-input medium-input" id="ho_ten" name="ho_ten"> <span  style="display:none" id="tb_ho_ten" class="input-notification error png_bg">Bạn chưa nhập họ tên</span> </td> 
                  </tr>
                  <tr>
                    <td><label> Loại hỗ trợ </label></td> 
                    <td>
                        <label>
                          <input type="radio" name="loai_ho_tro" value="1" checked="checked">
                          yahoo </label> 
                        <label>
                          <input type="radio" name="loai_ho_tro" value="2">
                          skype</label> 
                    </td>
                  </tr>
                  <tr class="alt-row">
                    <td><label class="required"> Nick chat </label> </td>
                    <td width="50px"><p>
                      <input type="text" class="text-input medium-input" id="nick_chat" name="nick_chat" value=""> <span style="display:none" id="tb_nick_chat" class="input-notification error png_bg">Bạn chưa nhập nick chat</span>
                      </p>
                      <p><small>(Ví dụ: abc@yahoo.com)</small> </p></td>
                  </tr>
                  <tr>
                    <td><label> Trạng thái </label> </td> </span>
                    <td><label>
                        <input type="radio" name="trang_thai" value="1" checked="checked">
                        Hiển thị</label>
                      <label>
                        <input type="radio" name="trang_thai" value="0">
                        Không hiển thị</label></td>
                  </tr>
                  <tr class="alt-row">
                    <td><label>Thứ tự hiển thị</label></td> 
                    <td><input type="text" onkeypress="return inputNumber(event)" class="text-input medium-input " id="thu_tu_hien_thi" name="thu_tu_hien_thi" value="0"> <span  style="display:none" id="tb_thu_tu_hien_thi" class="input-notification error png_bg">Bạn chưa nhập thứ tự hiển thị</span>  </td> 
                  </tr>
                  <tr>
                    <td style="text-align:center" colspan="2"><div class="nut">
                        <p>
                          <input type="submit" class="button" name="luu_va_thoat" value="Lưu và thoát"  onclick="return kiemtra()">
                          <input type="submit" class="button" name="luu_va_tiep_tuc" value="Lưu và tiếp tục">
                          <input type="button" class="button" value="Quay vể" name="khong_luu" onclick="window.location.href='list.php'">
                        </p>
                      </div></td>
                  </tr>
                </tbody>
              </table>
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->
            
          </form>
        </div>
        <!-- End #tab2 --> 
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <?php include '../widgets/footer.php'?>
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>
